-- 2.2 sqoop执行导入
-- 2.2.1 ods_web_chat_ems表导入
sqoop import \
--connect jdbc:mysql://hadoop01:3306/nev \
--username root \
--password 123456 \
--query "select id, create_date_time, session_id, sid, create_time, seo_source, seo_keywords, ip, area, country, province, city, origin_channel, user, manual_time, begin_time, end_time, last_customer_msg_time_stamp, last_agent_msg_time_stamp, reply_msg_count, msg_count, browser_name, os_info, '2019-07-25' as dt from nev.web_chat_ems_2019_07 where date(create_time)='2019-07-25' and \$CONDITIONS" \
--hcatalog-database db_ods \
--hcatalog-table ods_web_chat_ems  \
--fields-terminated-by  '\t' \
-m 1
wait
-- 2.2.2 ods_web_chat_text_ems表导入
sqoop import \
--connect jdbc:mysql://hadoop01:3306/nev \
--username root \
--password 123456 \
--query "select wcte.id, wcte.referrer, wcte.from_url, wcte.landing_page_url, wcte.url_title, wcte.platform_description, wcte.other_params, wcte.history, '2019-07-25' as dt from nev.web_chat_text_ems_2019_07 wcte join nev.web_chat_ems_2019_07 wce on wcte.id=wce.id where date(wce.create_time)='2019-07-25' and \$CONDITIONS" \
--hcatalog-database db_ods \
--hcatalog-table ods_web_chat_text_ems  \
--fields-terminated-by  '\t' \
-m 1